"""
Get sample list from data directory
"""
import os

def get_samples(dp: str, suffix: str, snr: list) -> list:
    """get sample list from data directory

    Args:
        dp (str): directory path
        suffix (str): suffix of target file
        snr (str): sample name rule

    Returns:
        list: sample list in directory path
    """
    total_names = [
        name[snr[0] : snr[1]]
        for name in os.listdir(dp)
        if (name[-len(suffix) :] == suffix) and (name[0] != ".")
    ]
    name_set = list(set(total_names))
    names = [name for name in name_set if total_names.count(name) == 2]
    names.sort()

    return names
